#ifndef GUICOMPONENT_H_
#define GUICOMPONENT_H_

#include "irrlicht.h"

#include "guiFactory.h"

using namespace irr;

class guiComponent {
	friend class guiFactory;
	static s32 s_uniqueID;
	s32 m_X;
	s32 m_Y;
	bool m_isChild;
	guiComponent* m_parent;
	protected:
		gui::IGUIElement* m_irrComp;
		const s32& getID() {
			s_uniqueID++;
			return s_uniqueID;
		}
	public:
		guiComponent(guiComponent* par = 0);
		virtual bool hasID(const s32& id) = 0;
		virtual void handleEvent(const s32& id, const SEvent& event) = 0;
		guiComponent* getParent() { return m_parent; }
		inline s32 getXLoc() { return m_X; }
		inline s32 getYLoc() { return m_Y; }
		inline void setXLoc(s32 x) { m_X = x; }
		inline void setYLoc(s32 y) { m_Y = y; }
		inline bool isChild() { return m_isChild; }
		virtual gui::IGUIElement* getIrrComponent() { return m_irrComp; } 
		
		// TODO: Maybe make a class that'll composite in these?
		virtual core::stringw getText() { return core::stringw(""); }
		virtual core::stringw getTooltip() { return core::stringw(""); }
		virtual void setText(core::stringw txt) { }
		virtual void setTooltip(core::stringw txt) { }
		
		virtual ~guiComponent();
};

#endif /*GUICOMPONENT_H_*/
